$(function () {
  $.ajax({
    url: "http://jx.xuzhixiang.top/ap/api/productlist.php",
    type: "get",
    data: { uid: 69007 },
    success: function (res) {
      // console.log(res);
      let list = document.querySelector("#listbox");
      let str = "";
      for (var i = 0; i < res.data.length; i++) {
        str += `<li><a href="detail.html?id=${res.data[i].pid}" target="_blank"><img src="${res.data[i].pimg}"></a><a href="detail.html?id=${res.data[i].pid}"><span>${res.data[i].pname}</span></a><p>￥${res.data[i].pprice}元</p><a href="detail.html?id=${res.data[i].pid}"><input value="加入购物车"></a></li>`
      }
      list.innerHTML = str;
    }
  });
});